package behavioral.interpret;

/**
 * @Description: 加法解释器
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class AddExpression implements IExpression {
    IExpression leftExpression;
    IExpression rightExpression;

    public AddExpression(IExpression leftExpression, IExpression rightExpression) {
        this.leftExpression = leftExpression;
        this.rightExpression = rightExpression;
    }
    public double interpreter() {
        return leftExpression.interpreter() + rightExpression.interpreter();
    }
}
